Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/sink(ticdc): iterate all Kafka configs to support KOP #8893

Merged
merged 4 commits into from
May 7, 2023

Conversation

Rustin170506
Copy link
Member

What problem does this PR solve?

Issue Number: close #8892

What is changed and how it works?

Iterate all Kafka configs to support KOP.

Check List

Tests

Questions

Will it cause performance regression or break compatibility?

No

Do you need to update user documentation, design documentation or monitoring documentation?

No

Release note

 Iterate all config items to support KOP when getting the broker's configs

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 6, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • asddongmen
  • nongfushanquan

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 6, 2023
@Rustin170506
Copy link
Member Author

Rustin170506 commented May 6, 2023

In addition to these tests, I also tested the multi-topic feature.

  1. Start Kop with docker-compose
  2. Start TiDB cluster tiup playground v6.5.0 --tiflash 0
  3. Build and start TiCDC server
  4. Create a changefeed with multi-topic config: ./cdc cli changefeed create --sink-uri="kafka://10.2.xxx:19092/testdsada?max-message-bytes=1048576&protocol=canal-json&kafka-version=2.9.0&replication-factor=1" --config=./changefeed.toml
[sink]
enable-kafka-sink-v2 = true
dispatchers = [{matcher = ['*.*'], topic = "tidb_{schema}_{table}"}]
  1. Write some data in upstream
mysql> use test;
Database changed
mysql> CREATE TABLE example1 (   id INT PRIMARY KEY,   b INT );
Query OK, 0 rows affected (0.15 sec)

mysql> INSERT INTO example1 (id,b) VALUES (2,2);
Query OK, 1 row affected (0.01 sec)

mysql> CREATE TABLE example2 (   id INT PRIMARY KEY,   b INT );
Query OK, 0 rows affected (0.09 sec)

mysql> INSERT INTO example2 (id,b) VALUES (2,2);
Query OK, 1 row affected (0.00 sec)
  1. check the topic with kcat:
Metadata for all topics (from broker 1960160947: 10.2.xxxx:19092/1960160947):
 1 brokers:
  broker 1960160947 at 10.2.xxxx7:19092 (controller)
 4 topics:
  topic "testdsada" with 3 partitions:
    partition 0, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 1, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 2, leader 1960160947, replicas: 1960160947, isrs: 1960160947
  topic "tidb_test_example2" with 3 partitions:
    partition 0, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 1, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 2, leader 1960160947, replicas: 1960160947, isrs: 1960160947
  topic "not_exist" with 3 partitions:
    partition 0, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 1, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 2, leader 1960160947, replicas: 1960160947, isrs: 1960160947
  topic "tidb_test_example1" with 3 partitions:
    partition 0, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 1, leader 1960160947, replicas: 1960160947, isrs: 1960160947
    partition 2, leader 1960160947, replicas: 1960160947, isrs: 1960160947
  1. Check the data with kcat:
kcat  -b 10.2.xxxx:19092 -t tidb_test_example2 -o -10000
% Auto-selecting Consumer mode (use -P or -C to override)
{"id":0,"database":"test","table":"example2","pkNames":null,"isDdl":true,"type":"CREATE","es":1683358998100,"ts":1683358998598,"sql":"CREATE TABLE `example2` (`id` INT PRIMARY KEY,`b` INT)","sqlType":null,"mysqlType":null,"data":null,"old":null}
{"id":0,"database":"test","table":"example2","pkNames":["id"],"isDdl":false,"type":"INSERT","es":1683359005400,"ts":1683359005922,"sql":"","sqlType":{"id":4,"b":4},"mysqlType":{"id":"int","b":"int"},"old":null,"data":[{"id":"2","b":"2"}]}


kcat  -b 10.2.xxxx:19092 -t tidb_test_example1 -o -10000
% Auto-selecting Consumer mode (use -P or -C to override)
{"id":0,"database":"test","table":"example1","pkNames":null,"isDdl":true,"type":"CREATE","es":1683358986400,"ts":1683358986592,"sql":"CREATE TABLE `example1` (`id` INT PRIMARY KEY,`b` INT)","sqlType":null,"mysqlType":null,"data":null,"old":null}
{"id":0,"database":"test","table":"example1","pkNames":["id"],"isDdl":false,"type":"INSERT","es":1683358992000,"ts":1683358992389,"sql":"","sqlType":{"id":4,"b":4},"mysqlType":{"id":"int","b":"int"},"old":null,"data":[{"id":"2","b":"2"}]}

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 6, 2023
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 6, 2023
@Rustin170506
Copy link
Member Author

/test all

@Rustin170506
Copy link
Member Author

/retest

@Rustin170506
Copy link
Member Author

/test all

@Rustin170506
Copy link
Member Author

/retest

@Rustin170506
Copy link
Member Author

/merge

/test all

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 6, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 10f9489

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 6, 2023
@Rustin170506
Copy link
Member Author

/test all

@Rustin170506
Copy link
Member Author

/test pull-dm-integration-test

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 6, 2023

@hi-rustin: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test cdc-integration-kafka-test
  • /test cdc-integration-mysql-test
  • /test cdc-integration-storage-test
  • /test dm-compatibility-test
  • /test dm-integration-test
  • /test engine-integration-test
  • /test verify

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tiflow/ghpr_verify

In response to this:

/test pull-dm-integration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Rustin170506
Copy link
Member Author

/test dm-integration-test

@Rustin170506
Copy link
Member Author

/test all

@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #8904.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request May 7, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #8905.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request May 7, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #8906.

@Rustin170506
Copy link
Member Author

/cherry-pick release-6.1-20230516-v6.1.3

@ti-chi-bot
Copy link
Member

@hi-rustin: new pull request created to branch release-6.1-20230516-v6.1.3: #8966.

In response to this:

/cherry-pick release-6.1-20230516-v6.1.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request May 16, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Rustin170506 added a commit to Rustin170506/tiflow that referenced this pull request Jun 8, 2023
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not create changefeed with KOP downstrems
4 participants